//
//  TableVCVM.h
//  
//  jhf
//
//  Created by Mac on 2019/8/12.
//  Copyright © 2019 计海峰. All rights reserved.
//

#import "CPBaseTableViewModel.h"

#import <ReactiveObjC/ReactiveObjC.h>
#import <KVOMutableArray/KVOMutableArray.h>
#import <KVOMutableArray/KVOMutableArray+ReactiveCocoaSupport.h>

#import "ImageControlM.h"
#import "Row.h"
#import "Section.h"
#import "BindModel.h"
#import "RowNeedM.h"
#import "Cooper_Table_Define.h"

typedef id _Nullable (^VmOtherServiceBlock)(id _Nullable obj);

NS_ASSUME_NONNULL_BEGIN

@interface TableVCVM : CPBaseTableViewModel

// 多个section
@property (nonatomic, strong) KVOMutableArray <Section *>*sections;

// 单个section使用
@property (nonatomic, strong) KVOMutableArray <Row *>*rows;

// temp使用
@property (nonatomic, strong) KVOMutableArray <Row *>*tempRows;

// 传输信号
@property (nonatomic, strong) RACSubject *transmitSignal;

// 绑定的key
@property (nonatomic, copy) NSString *bindKey;

// 初始化的model
@property (nonatomic, strong, readwrite) id model;

//MARK:-一般方法
// 默认是点击事件
- (void)actionTo:(id)model;

// 初始化结束
- (void)initDown;

// 配置结束
- (void)configDown;

// 一般用于固定rows
- (void)forRows;

// 隐藏键盘
- (void)hiddeKeyboard;

- (NSIndexPath *)searchRow:(NSString *)actionKey;
- (BindModel *)searchBind:(NSString *)actionKey;

// MARK: - gen rows
- (Row *)genRowNeed:(RowNeedM *)needModel;
- (Row *)genRowId:(NSString *)identify;
- (Row *)genRowClass:(Class)cls;
- (Row *)genRowClass:(Class)cls model:(id)model;
- (Row *)genRowClassStr:(NSString *)clsStr;
- (Row *)genRowClassStr:(NSString *)clsStr model:(id)model;

//// 图片资源 返回 [files, names]
//- (NSArray *)imagesParams;
//
//- (NSArray <ImagesModel *>*)imagesModelsParams;


//MARK: - cell 上面操作
- (void)imageCellTap:(id)any;

// MARK: - 一些服务啥啥的

@property (nonatomic, copy) VmOtherServiceBlock block;

- (UIViewController *)bindTargetVC;

- (UITableView *)bindTargetTV;

- (UIView *)bindTargetView;

- (NSArray *)bindTargetAll;

// 不需要 返回提醒 <特殊使用>
@property (nonatomic, copy) NSString *noBackHint;

@end

NS_ASSUME_NONNULL_END
